home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group95c.txt
/
000075_icon-group-sender _Mon Nov 6 09:21:39 1995.msg
< prev
next >
Wrap
Internet Message Format
|
1996-01-03
|
1KB
Received: by cheltenham.cs.arizona.edu; Mon, 6 Nov 1995 12:26:55 MST
Date: Mon, 6 Nov 1995 09:21:39 -0800
From: kwalker@orville.premenos.com (Ken Walker)
Message-Id: <9511061721.AA21143@orville.orville.premenos.com.>
To: icon-group@cs.arizona.edu
Subject: an observation on Icon semantics
X-Sun-Charset: US-ASCII
Errors-To: icon-group-errors@cs.arizona.edu
I few months ago there was a discussion on whether DeMorgan's Law "worked" in Icon.
We concuded that it did. However, I've realized that an equivalence relationship
in boolean algebra does not apply to all Icon expressions. In general,
<expr> ~== "A"
and
not (<expr> == "A")
produce different success/failure results when <expr> is a generator. For example
!strings ~== "A"
succeeds if there exists an element x in strings such that x ~== "A", but
not (!strings == "A")
succeeds if there does not exist an x in strings, such that x == "A". This is the same
as saying that for all x in strings, x ~== "A". The difference in semantics is the
difference between "there exists" and "for all". It's nice to know that there is a
short expression like
not (!strings ~== "A")
which succeeds when all elements of strings equal "A", but to me it looks a little
perverse :-)
Ken Walker, kwalker@premenos.com
Premenos Coporation, Concord, Ca. 94520